package com.example.iterator.v1;

import java.util.ArrayList;
import java.util.Iterator;

public class Main {
    public static void main(String[] args) {
        ArrayList<String> objects = new ArrayList<>();
        objects.add("d");
        objects.add("e");
        objects.add("r");
        Iterator<String> iterator = objects.iterator();
        while (iterator.hasNext()){
            String next = iterator.next();
            System.out.println(next);
        }
        LinkedList_<Integer> list=new LinkedList_<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        System.out.println(list.size());
        for (int i = 0; i < list.size(); i++) {
            System.out.println("list = " + list.get(i));
        }
    }
}
